package com.xiaoshuidi.cloud.module.guanwang.controller.app.guanwang;

import com.xiaoshuidi.cloud.framework.common.pojo.CommonResult;
import com.xiaoshuidi.cloud.module.guanwang.controller.admin.guanwang.vo.GuanWangConfigListRespVO;
import com.xiaoshuidi.cloud.module.guanwang.enums.ApiConstants;
import com.xiaoshuidi.cloud.module.guanwang.service.guanwang.GuanWangConfigService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.annotation.security.PermitAll;

import static com.xiaoshuidi.cloud.framework.common.pojo.CommonResult.success;

@Tag(name = "PC - 官网配置")
@RestController
@RequestMapping(ApiConstants.NAME + "/config")
public class AppGuanWangConfigController {

    @Resource
    private GuanWangConfigService guanWangConfigService;

    @PermitAll
    @GetMapping("/detail")
    @Operation(summary = "详情")
    public CommonResult<GuanWangConfigListRespVO> detail(@RequestParam(value = "indexId", required = true) Integer indexId){
        return success(guanWangConfigService.detail(indexId));
    }
}
